package consumer_manager

import "time"

// ConsumerStatus 消费者状态
type ConsumerStatus struct {
	ID                 int       `json:"id" db:"id"`
	ConsumerName       string    `json:"consumer_name" db:"consumer_name"`
	ServerIP           string    `json:"server_ip" db:"server_ip"`
	Port               string    `json:"port" db:"port"`
	NSQLookupHost      string    `json:"nsq_lookup_host" db:"nsq_lookup_host"`
	NSQHTTPAddress     string    `json:"nsq_http_address" db:"nsq_http_address"`
	NSQAdminAddress    string    `json:"nsq_admin_address" db:"nsq_admin_address"`
	Topic              string    `json:"topic" db:"topic"`
	Channel            string    `json:"channel" db:"channel"`
	MaxConsumerCount   int       `json:"max_consumer_count" db:"max_consumer_count"`
	ConsumerCount      int       `json:"consumer_count" db:"consumer_count"`
	SpawnConsumerCount int       `json:"spawn_consumer_count" db:"spawn_consumer_count"`
	DepthLimit         int       `json:"depth_limit" db:"depth_limit"`
	ScalingMode        string    `json:"scaling_mode" db:"scaling_mode"`
	CreateTime         time.Time `json:"create_time" db:"create_time"`
	UpdateTime         time.Time `json:"update_time" db:"update_time"`
	ConsumerRemark     string    `json:"consumer_remark" db:"consumer_remark"`
}

// AdjustRequest 调整消费者数量请求
type AdjustRequest struct {
	ConsumerCount int `json:"consumer_count" binding:"required,min=1"`
}

// APIResponse 统一API响应格式
type APIResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

// StatusData 状态响应数据
type StatusData struct {
	CurrentCount       int    `json:"current_count"`
	MaxConsumerCount   int    `json:"max_consumer_count"`
	SpawnConsumerCount int    `json:"spawn_consumer_count"`
	DepthLimit         int    `json:"depth_limit"`
	ScalingMode        string `json:"scaling_mode"`
	ConsumerName       string `json:"consumer_name"`
	ServerIP           string `json:"server_ip"`
	Port               string `json:"port"`
	NSQLookupHost      string `json:"nsq_lookup_host"`
	NSQHTTPAddress     string `json:"nsq_http_address"`
	NSQAdminAddress    string `json:"nsq_admin_address"`
	Topic              string `json:"topic"`
	Channel            string `json:"channel"`
	LastUpdate         string `json:"last_update"`
	ConsumerRemark     string `json:"consumer_remark"`
}